<?php

require_once dirname(__FILE__) . '/dedehttpdown.class.php';

function dede_fetch($url, $curr_retry_count = 0, $max_retry_count = 1) {
    $intTimeStart = microtime(true);
    $logString = 'Fetching:' . $url;

    $o = new DedeHttpDown;
    $o->OpenUrl($url);
    $s = $o->GetHtml();

    $http_status_code = $o->m_httphead['http-state'];

    $intTimeEnd = microtime(true);
    log::n('HttpStatusCode:' . $http_status_code . '|RequestTime:' . ($intTimeEnd - $intTimeStart) . 's|' . $logString);

    return $s;
}

?>